namespace KinonekoSoftware.Studio.Models.Modules.RVE
{
    public sealed class RVEZodiacPresenter : RVE_Presenter<RVE_Zodiac>
    {
        public override string               GetTitle()                     => CodariaSR.Module_RVE_Zodiac ;
        public override bool                 IsMultipleVariants()           => false;
        public override IEnumerable<Variant> GetVariants(string documentID) => null;
        public override Variant GetVariant(string documentID)
        {
            return new StringVariant
            {
                Id       = documentID,
                Metadata = Metadata,
                Value    = Zodiac.ToString(),
                Type     = VariantType.String,
            };
        }

        public Zodiac Zodiac
        {
            get => AssociatedObject.Value;
            set
            {
                AssociatedObject.Value = value;
                ValueChanged?.Invoke(value);
                RaiseUpdated();
                RaisePropertyUpdated(Metadata);
            }
        }


        public string Metadata
        {

            get
            {
                if (AssociatedObject is null)
                {
                    return string.Empty;
                }

                return AssociatedObject?.Metadata;
            }
            set
            {
                if (AssociatedObject is null)
                {
                    return;
                }

                AssociatedObject.Metadata = value;
                RaiseUpdated();
            }
        }

        public event Action<Zodiac> ValueChanged;
    }
}